package com.lanmon.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name="organization")  
@JsonIgnoreProperties( value={"hibernateLazyInitializer","handler"})
public class Organization implements Serializable{
	private Integer orgid;
	private Organization organization;
	private String orgname;
	
	@GenericGenerator(name = "generator", strategy = "identity")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "orgid", unique = true, nullable = false)
	public Integer getOrgid() {
		return orgid;
	}
	public void setOrgid(Integer orgid) {
		this.orgid = orgid;
	}
	
	@OneToOne(fetch=FetchType.LAZY)  
	@JoinColumn(name="p_orgid")  
	public Organization getOrganization() {
		return organization;
	}
	
	public void setOrganization(Organization organization) {
		this.organization = organization;
	}
	
	public void setOrgname(String orgname) {
		this.orgname = orgname;
	}
	
	@Column(name = "orgname", unique = true, nullable = false)
	public String getOrgname() {
		return orgname;
	}
	
	
}
